package natappvip.liujinliang;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;

import natappvip.liujinliang.controller.DeleteServlet;
import natappvip.liujinliang.controller.DownloadServlet;
import natappvip.liujinliang.controller.MetaDataGetServlet;
import natappvip.liujinliang.controller.UploadServlet;

/**
 * @ClassName:  FileSystemServer   
 * @Despt: 文件系统服务端   
 * @Auth: Liujinliang 
 * @Date: 2018年7月29日 下午9:30:09
 */
public class FileSystemServer {

	public static void main( String[] args ) throws Exception
    {
        Server server = new Server(8090);

        ServletHandler handler = new ServletHandler();
        server.setHandler(handler);

        handler.addServletWithMapping(UploadServlet.class, "/upload");
        handler.addServletWithMapping(MetaDataGetServlet.class, "/mdata");
        handler.addServletWithMapping(DownloadServlet.class, "/download");
        handler.addServletWithMapping(DeleteServlet.class, "/delete");

        server.start();
        server.join();
    }
}
